length=int(input())
string=str(input())
times=0
def judge(string):
    for i in range(length-1):
        if (string[i]=="V" and string[i+1]=="K") :
            global times
            times+=1
for i in range(length-1):
    judge(string)

for i in range(length-1):
    if length==2:
        if string=="VK":
           break
        else:
            new_string="VK"
    else:
        new_string=string[:i]+"V"+string[i+1:]
    judge(new_string)

for i in range(length-1):
    if length==2:
        if string=="VK":
           break
        else:
            new_string="VK"
    else:
        new_string=string[:i]+"K"+string[i+1:]
    judge(new_string)
print(times)
